<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8"/>
	<meta name="baidu-site-verification" content="JdMif0g2tL" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>angular</title>
</head>
<body ng-app="myApp">

<div ng-controller="appCtrl">
	<div my-title></div>
	<my-title>你好，今天是5月7号</my-title>
	<div class="my-title">你好，今天是5月7号</div>
</div>

<script type="text/javascript">
	document.getElementsByTagName('html')[0].style.fontSize=window.screen.width/10+'px';
</script>
<script src="../js/angular.min.js" charset="utf-8"></script>
<script type="text/javascript">
	var app =angular.module('myApp', []);
	app.directive("myTitle",function(){
		return{
			//四大类型ECMA，
			//template表示自定义指令模板
			//replace表示是否替换该元素
			//E：元素自定义元素类型的自定义指令<my-title></my-title>
			//C：class类自定义<div  class="my-title"></div>
			//M：注释指令（应用很少）<!--directtive:my-title-->
			//A：元素属于自定义指令<div my-title></div>
			restrict: 'ECA',
			template: '<div>你好，今天是5月7号</div>',
			replace: true

		}
	})
</script>
<!-- <script src="js/index.js" charset="utf-8"></script> -->
</body>
</html>
<!--应该 13.1-->